package com.gxa.dao;

import com.gxa.pojo.Alarm;
import com.gxa.pojo.AlarmVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.List;
@Repository
public interface AlarmMapper {

    @Select("select * from alarm limit #{begin},#{limit}")
    List<Alarm> showAlarm(AlarmVO alarmVO);

    int getCount();

    List<Alarm> selectByCondition(AlarmVO alarmVO);

    @Insert("INSERT INTO alarm(alarmRulesId,alarmRulesName,notifyUsers,pushMode,alarmRules,alarmType,alarmLevel,creatTime) VALUES\n" +
            "(DEFAULT,#{alarmRulesName},#{notifyUsers},#{pushMode},#{alarmRules},#{alarmType},#{alarmLevel},#{creatTime})")
    int addAlarm(Alarm alarm);

    @Delete("DELETE FROM alarm WHERE alarmRulesName=#{alarmRulesName}")
    int deleteByAlarmRulesName(String alarmRulesName);


}
